package com.hdd.biz.painting.controller;


import com.hdd.biz.painting.dto.FileInfoRequest;
import com.hdd.biz.painting.dto.FileListRequest;
import com.hdd.biz.painting.dto.FileRequest;
import com.hdd.biz.painting.dto.MaterialKindListRequest;
import com.hdd.biz.painting.service.FileInfoService;
import com.hdd.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 文件表 前端控制器
 * </p>
 *
 * @author fang
 * @since 2021-03-10
 */
@RestController
@RequestMapping("/painting/file")
@Api(value = "素材分类列表",tags = {"素材分类列表"})
@CrossOrigin(origins = "*",maxAge = 3600)
public class FileInfoController {

    @Autowired
    private FileInfoService fileInfoService;


    @PostMapping("/getMateriaSonList")
    @ApiOperation(value = "裱框子元素列表" ,notes = "")
    public SuperResponse getMateriaSonList(@Valid @RequestBody FileListRequest request ){
        return fileInfoService.getMateriaSonList(request);
    }


    @PostMapping("/materiaSonAdd")
    @ApiOperation(value = "裱框子元素添加" ,notes = "")
    public SuperResponse materiaSonAdd(@Valid @RequestBody FileInfoRequest request ){
        return fileInfoService.materiaSonAdd(request);
    }


    @PostMapping("/materiaSonUpdate")
    @ApiOperation(value = "裱框子元素修改" ,notes = "")
    public SuperResponse materiaSonUpdate(@Valid @RequestBody FileInfoRequest request ){
        return fileInfoService.materiaSonUpdate(request);
    }


    @PostMapping("/materiaSonDel")
    @ApiOperation(value = "裱框子元素删除" ,notes = "")
    public SuperResponse materiaSonDel(@Valid @RequestBody FileRequest request ){
        return fileInfoService.materiaSonDel(request);
    }


}

